// Import some needed classes
import sun.net.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.*;
import java.util.Timer;

public class ServerConnector {
	private static Socket socket;
	
	public ServerConnector(){
		
		try {
			socket = new Socket("94.234.170.95", 23);

			System.out.println("AISPUSH.java--------------------------" + 1);




		} catch (Exception e) {
			System.out.println(e);

		}

		
	}


	public void sendAis(String ais) throws Exception {



		// write to server
		OutputStream os;
		try {
			os = socket.getOutputStream();

		os.write(ais.getBytes(), 0, ais.length());
		System.out.println("AISPUSH.java--------------------------" + 2);


//		os.close();
		
		} catch (IOException e) {
			e.printStackTrace();
		}

	}



}